<%layout("/common/layout.html"){%>

<div class="center-block sin-wrap-content">
    <div class="layer">
        <img src="${design.img}" alt="背景" class="img-blur">
    </div>
    <div class="center-block tshirt">
        <div class="clearfix sg-func">
            <div class="collect">
                <%if(has(isCollected)){%>
                <%if(isCollected!=true){%>
                <a href="${ctxPath}/user/addCollect?design=${design.id}" class="btn btn-danger">
                    <span class="glyphicon glyphicon-star-empty" aria-hidden="true"></span>
                    收藏
                </a>
                <%}else{%>
                <a href="${ctxPath}/user/deleteCollect?design=${design.id}" class="btn btn-danger">
                    <span class="glyphicon glyphicon-star-empty" aria-hidden="true"></span>
                    取消收藏
                </a>
                <%}%>
                <%}%>
            </div>
            <div class="share">
                <button class="btn btn-default" id="btn-share">
                    <span class="glyphicon glyphicon-share" aria-hidden="true"></span>
                    <span class="link" style="display:none">分享:<span>QQ</span><span>新浪微博</span><span>豆瓣</span></span>
                </button>
            </div>
        </div>
        <div class="wrap-showArea">
            <div class="showArea">
                <div class="sin-wrap-img">
                    <img src="${design.img}" alt="这件T"/>
                </div>
            </div>
        </div>
        <div class="show-desc">
            <p>${design.content}</p>
        </div>
        <div class="func-buy">
            <span>￥${design.price}</span>
            <a href="${ctxPath}/design/info?design=${design.id}" class="btn btn-default pull-right">买买买</a>

            <div class="clear"></div>
        </div>
    </div>
    <div class="buy-who">

        <%if(user_buy.~size!=0){%>

        <%for(order in user_buy){%>

        <div class="who-avatar">
            <a href="${ctxPath}/user/userInfo?user=${order.user.id}">
                <img src="${order.user.img}" alt="who1"/>
            </a>
        </div>

        <%}%>

        <span>已入手！！！</span>

        <%}%>
    </div>
</div>
<div class="comment">
    <div class="center-block wrap-comment">
        <p><span>评论</span></p>

        <div class="my-comment">

            <%if(session.user!=null){%>

            <form action="${ctxPath}/design/addPost" method="post" id="comment">
                <div class="com-avatar">
                    <img src="${session.user.img}" alt="头像"/>

                    <p><a href="${ctxPath}/user/userInfo?user=${session.user.id}">${session.user.name}</a></p>
                </div>
                <input type="hidden" name="design" value="${design.id}">

                <div class="com-input">
                    <textarea name="content" id="mycomment" cols="30" rows="5" placeholder="有什么想说的？"></textarea>
                </div>
                <div class="clear"></div>
                <button type="submit" class="btn btn-info btn-lg">发表</button>
            </form>

            <%}else{%>

            <p>登录后即可留言</p>

            <%}%>
        </div>

        <%for(post in page.list){%>

        <div class="clearfix other-comment">
            <div class="com-avatar">
                <img src="${post.user.img}" alt="xxx头像"/>

                <p><a href="${ctxPath}/user/userInfo?user=${post.user.id}">${post.user.name}</a></p>

                <p class="time">${printTime(post.time)}</p>
            </div>
            <div class="com-content">
                <p>${post.content}</p>
            </div>
        </div>

        <%}%>


    </div>
    <div class="page">

        <%include("/common/paginate.html",{"currentPage":page.pager.pageNumber,"totalPage":page.pager.pageCount,"actionUrl":actionUrl!})
        {}%>

    </div>
</div>


<%include("/common/footer.html"){}%>


<script src="${ctxPath}/js/jquery-2.1.1.min.js"></script>
<script src="${ctxPath}/js/nav.js"></script>
<script src="${ctxPath}/js/singleT.js"></script>

<%}%>